import request from '@/utils/request'

// 缴费记录列表
export function payRemakList(query) {
    return request({
        url: `/system/purchasegasrecord/list`,
        method: 'get',
        params: query
    })
}

// 缴费记录详情
export function payRemakInfo(query) {
    return request({
        url: `/system/purchasegasrecord/${query}`,
        method: 'get',
    })
}

// 缴费
export function getPay(data) {
    return request({
        url: `/system/noCardPay/pay`,
        method: 'post',
        data: data
    })
}

// 新增参数配置
export function addConfig(data) {
    return request({
        url: '/system/config',
        method: 'post',
        data: data
    })
}

// 修改参数配置
export function updateConfig(data) {
    return request({
        url: '/system/config',
        method: 'put',
        data: data
    })
}

// 删除参数配置
export function delConfig(configId) {
    return request({
        url: '/system/config/' + configId,
        method: 'delete'
    })
}

// 开阀
export function openValue(data) {
    return request({
        url: '/system/instruct/openValve',
        method: 'post',
        params: data,

    })
}

// 关阀
export function closeValue(data) {
    return request({
        url: '/system/instruct/closeValve',
        method: 'post',
        params: data
    })
}

// 激活
export function activationValue(data) {
    return request({
        url: '/system/instruct/activation',
        method: 'post',
        params: data
    })
}

// 获取订单id
export function getPayID(query) {
    return request({
        url: `/system/createOrderNo/${query}`,
        method: 'get',
    })
}
// 开关阀历史记录
export function getHistory(query) {
    return request({
        url: `/system/instructLog/list`,
        method: 'get',
        params: query
    })
}

// 获取打印数据
export function getPrint(query) {
    return request({
        url: `/system/purchasegasrecord/print/${query}`,
        method: 'get',
    })
}

// 撤销支付
export function revokePayment(query) {
    return request({
        url: `/system/noCardPay/payRevoke`,
        method: 'get',
        params: query
    })
}
